package pl.edu.agh.anomalyids.launcher.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

import org.slf4j.Logger;

import pl.edu.agh.anomalyids.network.Interface;

public class LauncherUtils {
	public static String getUserInput(Logger logger) {
		System.out.println("Choose interface number...");
		BufferedReader bufferReader = new BufferedReader(new InputStreamReader(System.in));
	    try {
			return bufferReader.readLine();
		} catch (IOException e) {
			logger.error("Cannot read user input.", e);
		}
	    
	    return null;
	}
	
	public static void printInterfaces(List<Interface> interfaces) {
		int interfaceNumber = 0;
		for (Interface inte : interfaces) {
			System.out.println(interfaceNumber++ + ": " + inte);
		}
	}
	
	public static long secondsToMiliseconds(long seconds) {
		return seconds * 1000;
	}
}
